<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();

const goBack = () => {
  router.back();
};
</script>

<template>
  <div class="container">
    <button class="back-button" @click="goBack">&#8592; 返回</button>
    <div class="main">
      <h1 class="animated-text">404</h1>
      <p class="sub-text">Not Found</p>
    </div>
  </div>
</template>

<style scoped lang="less">
@import "../../assets/main.less";

.container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f8f8f8;
}

.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 10px 15px;
  font-size: 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.back-button:hover {
  background: #2980b9;
}

.main {
  text-align: center;
}

.animated-text {
  font-size: 100px;
  font-weight: bold;
  color: red;
  animation: bounce 1.5s infinite;
}

.sub-text {
  font-size: 24px;
  color: #666;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
</style>
